
<style>
.max-line1 {
    text-overflow: -o-ellipsis-lastline;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;	
}
.max-line2 {
    text-overflow: -o-ellipsis-lastline;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
</style>
<style>
.media-body .summary {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
	text-overflow: ellipsis;
    overflow: hidden;
}
.media-list img {width: 200px;}
@media (max-width: 425px)  {
    .media-list img {width: 115px;}	
    .media-body .summary {display: none;}
}
</style>

<h3 class="page-header">轮播图
<a href="<?= URL::site('rotationMap/add');?>" class="ajax-click">+</a>
</h3>

<form class="form-inline ajax-submit" method="get">

    <div class="form-group">
        <select class="form-control" name="status">
			<option value="">选择状态</option>
			<option value="1" <?php if(Arr::get($_GET, 'status')=='1'):?>selected<?php endif;?>>已发布</option>
			<option value="0" <?php if(Arr::get($_GET, 'status')=='0'):?>selected<?php endif;?>>已关闭</option>
        </select>
    </div>
    
    <div class="form-group">
        <select class="form-control" name="category">
			<option value="">选择轮播图位置</option>
			<option value="1" <?php if(Arr::get($_GET, 'category')=='1'):?>selected<?php endif;?>>PC首页轮播图</option>
            <option value="2" <?php if(Arr::get($_GET, 'category')=='2'):?>selected<?php endif;?>>PC行业资讯轮播图</option>
            <option value="3" <?php if(Arr::get($_GET, 'category')=='3'):?>selected<?php endif;?>>APP端首页轮播</option>
            <option value="4" <?php if(Arr::get($_GET, 'category')=='4'):?>selected<?php endif;?>>APP端课堂轮播</option>
			<option value="5" <?php if(Arr::get($_GET, 'category')=='5'):?>selected<?php endif;?>>APP端课堂精品轮播</option>
        </select>
    </div>
    
    <div class="form-group">
        <div class="input-group">
            <span class="input-group-btn">
                <button class="btn btn-info" type="submit">查找</button>
            </span>
        </div>
     </div>
</form>
<br>

<ul class="media-list">
<?php foreach($list as $item): ?>
    <li class="media">
        <div class="media-left">
            <?php if (strpos($item['pic'], '://') !== false):?>
            <?= HTML::image($item['pic'].'?imageView2/2/w/160/h/120') ?>
            <?php else:?>
            <?= HTML::image('/imagefly/w160-h120-c/' . $item['pic']) ?>
            <?php endif;?>
            
        </div>
        <div class="media-body">
            <p class="text-muted summary"><?= $item['jump_url']?></p>
            <div class="text-muted max-line1"><?= date('Y-m-d H:i:s', $item['add_time']) ?></div>
            
            
            
            <?php if ($item['status']=='1'):?>
            <a href="<?= URL::site('rotationMap/close?id='.$item['id']);?>" class="btn btn-danger btn-xs ajax-update">关闭</a>
            <?php else:?>
            <a href="<?= URL::site('rotationMap/open?id='.$item['id']);?>" class="btn btn-info btn-xs ajax-update">发布</a>
            <?php endif;?>
            
            <?php if ($item['category']=='1'):?>
            <a href="<?= URL::site('rotationMap/category1?id='.$item['id']);?>" class="btn btn-danger btn-xs ajax-update">PC首页轮播图</a>
            <?php elseif($item['category']=='2'):?>
            <a href="<?= URL::site('rotationMap/category2?id='.$item['id']);?>" class="btn btn-info btn-xs ajax-update">PC行业资讯轮播图</a>
            <?php elseif($item['category']=='3'):?>
            <a href="<?= URL::site('rotationMap/category2?id='.$item['id']);?>" class="btn btn-info btn-xs ajax-update">APP端首页轮播</a>
            <?php elseif($item['category']=='4'):?>
            <a href="<?= URL::site('rotationMap/category2?id='.$item['id']);?>" class="btn btn-info btn-xs ajax-update">APP端课堂轮播</a>
            <?php elseif($item['category']=='5'):?>
            <a href="<?= URL::site('rotationMap/category2?id='.$item['id']);?>" class="btn btn-info btn-xs ajax-update">APP端课堂精品轮播</a>
            <?php endif;?>
            
    	    <a href="<?= URL::site('rotationMap/edit')?>?id=<?= $item['id'] ?>" class="btn btn-info btn-xs ajax-click">修改</a>
        </div>
    </li>
<?php endforeach; ?>
</ul>

<?= $pager ?>
